package com.ilancuo.numric;

/**
 * 测试Ceil和Floor的用法
 * Created by ilancuo on 30/05/2017.
 */
public class CeilAndFloor {

    public static void main(String[] args) {
        float i = 3.4f;
        System.out.println("向上取整ceil: " + Math.ceil(i));
        System.out.println("向下取整floor: " + Math.floor(i));
        System.out.println("四舍五入round:" + Math.round(i));

        float x = 3.4f;
        float y = x * 2;
        int z = (int) y;
        float m = (float) z / 2;
        System.out.println(m);
    }
}
